home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / prodpack.zip / DB4PPSRC.EXE / _USED.PRG < prev    next >
Text File  |  1993-05-04  |  1KB  |  49 lines

  1. FUNCTION _Used       && Determine if a DBF is Open in Target Work Area
  2. PARAMETERS p__alias
  3. *-------------------------------------------------------------------------
  4. * NAME
  5. *   _Used - determine if alias in use, SELECT it if so.
  6. *
  7. * SYNOPSIS
  8. *   _Used( p__alias )
  9. *
  10. * DESCRIPTION
  11. *   The _USED() function returns true (.T.) if a
  12. *   database is open in the work area identified by
  13. *   <expr>.  In this case, the specified work area
  14. *   is also SELECTed by _USED() before it returns.
  15. *
  16. *   <expr> may be a work area alias, number
  17. *   or letter.  _USED() returns .F. if no database
  18. *   file is open in the specified work area, and
  19. *   the current work area remains unchanged.
  20. *
  21. * EXAMPLES
  22. *
  23. *   SELECT A
  24. *   USE Client
  25. *   SELECT B
  26. *   USE Items
  27. *   SELECT C
  28. *   USE Brett
  29. *   ? _USED(1)
  30. *     .T.
  31. *   ? _USED('B')
  32. *     .T.
  33. *   ? _USED('BRETT')
  34. *     .T.
  35. *   ? _USED(4)
  36. *     .F.
  37. *
  38. *-------------------------------------------------------------------------
  39.   *-- Check for the alias with the 1.2 SELECT()
  40.   IF SELECT( m->p__alias ) > 0
  41.     SELECT ( m->p__alias )
  42.     RETURN .T.
  43.   ELSE
  44.     RETURN .F.
  45.   ENDIF
  46.  
  47. *--EOF: _Used( p__alias )
  48.  
  49.